import axios from 'axios'

export function login (username, password) {
  const url = '/users/authenticate/username'

  return axios({
    method: 'GET',
    url,
    headers: {
      Authorization: 'Basic ' + btoa(username + ':' + password)
    }
  }).then((res) => {
    return Promise.resolve(res.data)
  }).catch((err) => {
    return Promise.reject(err)
  })
}
